package com.liao.myblog.dao;

import com.liao.myblog.pojo.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface BlogMapper {

    List<Blog> queryBlogList();

    int deleteBlog(int[] id);

    int saveBlog(Blog blog);

    Blog queryBlogById(int id);

    int updateBlogById(Blog blog);

    List<Blog> queryBlogByTitle(String title);

    int findBlogCount();

    List<Blog> findBlogByPaging(int limit, int offset, String keyword);

    List<Blog> queryNewBlog(int limit);

    List<Blog> queryHotBlog(int limit);

    int queryBlogCountByKeyword(String keyword);

    int queryBlogCountByCatalogueId(int catalogueId);

    List<Blog> queryBlogByCatalogueId(int catalogueId, int pageSize, int offset);
}
